{{ error|raw }}
<script>
    {{ get_js_value("window.Messages.strSavedOn", t('Saved on: @DATE@')) }}
</script>
<div class="row">
<div id="maincontainer" class="container-fluid">
<div class="row">
    <div class="col-12 col-md-7">
        <div class="card mt-4">
          <div class="card-header">
            {{ t('Import') }}
          </div>
          <div class="card-body">
            <form class="prefs-form disableAjax" name="prefs_import" action="{{ url('/preferences/manage') }}" method="post"
                  enctype="multipart/form-data">
                {{ get_hidden_inputs() }}
                <input type="hidden" name="json" value="">
                <input type="radio" id="import_text_file" name="import_type" value="text_file" checked="checked">
                <label for="import_text_file"> {{ t('Import from file') }} </label>
                <div id="opts_import_text_file" class="prefsmanage_opts">
                    <label for="input_import_file"> {{ t('Browse your computer:') }} </label>
                    <input type="file" name="import_file" id="input_import_file">
                </div>
                <input type="radio" id="import_local_storage" name="import_type" value="local_storage"
                       disabled="disabled">
                <label for="import_local_storage">{{ t("Import from browser's storage") }}</label>
                <div id="opts_import_local_storage" class="prefsmanage_opts disabled">
                    <div class="localStorage-supported">
                        {{ t("Settings will be imported from your browser's local storage.") }}
                        <br>
                        <div class="localStorage-exists">
                            {{ t('Saved on: @DATE@') }}
                        </div>
                        <div class="localStorage-empty">
                            {{ t('You have no saved settings!')|notice }}
                        </div>
                    </div>
                    <div class="localStorage-unsupported">
                        {{ t('This feature is not supported by your web browser')|notice }}
                    </div>
                </div>
                <input type="checkbox" id="import_merge" name="import_merge">
                <label for="import_merge"> {{ t('Merge with current configuration') }} </label>
                <br><br>
                <input class="btn btn-primary" type="submit" name="submit_import" value="{{ t('Go') }}">
            </form>
          </div>
        </div>
        {% if exists_setup_and_not_exists_config %}
            {# show only if setup script is available, allows to disable this message #}
            {# by simply removing setup directory #}
            {# Also do not show in config exists (and setup would refuse to work) #}
            <div class="card mt-4">
              <div class="card-header">
                {{ t('More settings') }}
              </div>
              <div class="card-body">
                {{ t('You can set more settings by modifying config.inc.php, eg. by using %sSetup script%s.')|format('<a href="setup/index.php" target="_blank">', '</a>')|raw }}
                {{ show_docu('setup', 'setup-script') }}
              </div>
            </div>
        {% endif %}
    </div>
    <div class="col-12 col-md-5">
        <div class="card mt-4">
          <div class="card-header">
            {{ t('Export') }}
          </div>
          <div class="card-body">
            <div class="click-hide-message hide">
                {{ t('Configuration has been saved.')|raw_success }}
            </div>
            <form class="prefs-form disableAjax" name="prefs_export"
                  action="{{ url('/preferences/manage') }}" method="post">
                {{ get_hidden_inputs() }}
                <div>
                    <input type="radio" id="export_text_file" name="export_type"
                           value="text_file" checked="checked">
                    <label for="export_text_file">
                        {{ t('Save as JSON file') }}
                    </label><br>
                    <input type="radio" id="export_php_file" name="export_type" value="php_file">
                    <label for="export_php_file">
                        {{ t('Save as PHP file') }}
                    </label><br>
                    <input type="radio" id="export_local_storage" name="export_type" value="local_storage"
                           disabled="disabled">
                    <label for="export_local_storage">
                        {{ t("Save to browser's storage") }}
                    </label>
                </div>
                <div id="opts_export_local_storage"
                     class="prefsmanage_opts disabled">
                    <span class="localStorage-supported">
                        {{ t("Settings will be saved in your browser's local storage.") }}
                      <div class="localStorage-exists">
                            <b>
                                {{ t('Existing settings will be overwritten!') }}
                            </b>
                        </div>
                    </span>
                    <div class="localStorage-unsupported">
                        {{ t('This feature is not supported by your web browser')|notice }}
                    </div>
                </div>
                <br>
                <input class="btn btn-primary" type="submit" name="submit_export" value="{{ t('Go') }}">
            </form>
          </div>
        </div>
        <div class="card mt-4">
          <div class="card-header">
            {{ t('Reset') }}
          </div>
          <div class="card-body">
            <form class="prefs-form disableAjax" name="prefs_reset"
                  action="{{ url('/preferences/manage') }}" method="post">
                {{ get_hidden_inputs() }}
                {{ t('You can reset all your settings and restore them to default values.') }}
                <br><br>
                <input class="btn btn-secondary" type="submit" name="submit_clear" value="{{ t('Reset') }}">
            </form>
          </div>
        </div>
    </div>
</div>
    <br class="clearfloat">
</div>
</div>
</div>
